import request from '@/config/axios'
import type { RoomFeature } from './types'

export const getRoomFeaturesListApi = (params: any): Promise<IResponse<IResData>> => {
  return request.get({ url: '/room-features', params })
}

export const createRoomFeaturesApi = (data: Partial<RoomFeature>): Promise<IResponse> => {
  return request.post({ url: '/room-features', data })
}

export const bulkCreateRoomFeaturesApi = (data: RoomFeature[]): Promise<IResponse> => {
  return request.post({ url: '/room-features/bulk', data })
}

export const updateRoomFeaturesApi = (
  id: string,
  data: Partial<RoomFeature>
): Promise<IResponse> => {
  return request.put({ url: `/room-features/id/${id}`, data })
}

export const getRoomFeaturesDetailApi = (id: string): Promise<IResponse<RoomFeature>> => {
  return request.get({ url: `/room-features/id/${id}` })
}

export const delRoomFeaturesListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.delete({ url: `/room-features/id/${ids[0]}` })
}
